Issue 18368 - -X should print all static information on stdout if no files are given#7840
Issue 18368 - -X should print all static information on stdout if no files are given#7840wilzbach wants to merge 1 commit intodlang:masterfrom
Conversation
|
We should keep things orthogonal: where we output json (file vs stdout) and what (with or without input files):
|
No.
Ok. I will change to this soon. |
| json_info(&buf); | ||
| buf.writestring("\n"); | ||
| // write to stdout for -X and -Xf=- | ||
| if (!global.params.jsonfilename || strcmp(global.params.jsonfilename, "-") == 0) |
There was a problem hiding this comment.
If wanted I can split this if statement and print the manual for -X (previous behavior).
|
what i meant was: |
|
FYI #7838 comes with the same behavior and actually already does what this PR was trying to do, so let's better move the discussion to that PR. |
Based on the discussion in #7521, dlang/tools#292 and #7838 the conclusion was the following:
-Xqwill allow querying (see Added -Xi to include new fields in JSON output #7838)-Xshould support printing to stdout if no files are given to satisfy the probing use case from Implement -probe for showing supported features #7521This is a simple version to get approval of the concept.
Moving over the full attributes from #7521 will be easy and can be done as a follow-up as for now this feature is undocumented.
As you might have noticed, this would also require refactoring the JsonWriter.